package com.topisv.tms.rest.qimen.command;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import com.topisv.tms.exception.PaiUException;
import com.topisv.tms.rest.qimen.qmservice.SingleGoodsInfoSyncService;
import com.topisv.tms.rest.qimen.request.RequestMethodType;
import com.topisv.tms.rest.qimen.request.RequestParams;
import com.topisv.tms.rest.qimen.response.ResponseParams;

/**
 * 单商品信息同步
 *  Date          Author       Version       Description
 * ----------------------------------------------------------
 *  2015-5-5      CC            1.0           Create
 */
@Component
@Lazy(false)
public class SingleGoodsInfoSyncCommand implements IQMRequestCommand,InitializingBean {
	@Autowired
	private SingleGoodsInfoSyncService singleGoodsInfoSyncService;

	@Override
	public ResponseParams execute(RequestParams params) throws PaiUException {
		return singleGoodsInfoSyncService.execute(params);
	}

	@Override
	public void afterPropertiesSet() {
		QMRequestCommandContainer.getInstance().add(RequestMethodType.SINGLEITEM_SYNC.getType(), this);
	}

	@Override
	public void executeBefore(ResponseParams qmResponse) throws PaiUException {
	}

}
